﻿<%@ Page Language="C#" MasterPageFile="~/Masterlayout.master" AutoEventWireup="true" CodeFile="Orders.aspx.cs" Inherits="Orders" Title="Order" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style>
.tb5 {
	        border:2px solid #456879;
	        border-radius:10px;
	        
             margin-left: 0px;
            
          }
          </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div>
        <table width="100%">
            <tr>
                <td width="40%">
                    <table style="margin-left:40px">
                        <tr>
                            <td>
                                Order ID
                            </td>
                            <td>
                                <asp:TextBox ID="txtOrderID" Width="175px" runat="server" Enabled="False" class="tb5"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Customer
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlCustomer" Width="180px" runat="server" class="tb5">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Employee
                            </td>
                            <td>
                                <asp:DropDownList required ID="ddlEmployee" Width="180px" runat="server" class="tb5">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Order Date
                            </td>
                            <td>
                            <%--<asp:HiddenField ID="txtOrderDate" runat="server" />--%>
                                <asp:TextBox ID="txtOrderDate" required Width="175px" NAME="txtOrderDate" runat="server" class="tb5"></asp:TextBox>
                                <%--<a href="#" onclick="cal.select(document.forms['form1'].txtOrderDate,'anchor1','yyyy-MM-dd'); return false;"
                                    name="anchor1" id="anchor1">select</a>--%>
                                <input id="dtOrderDate" type="date" onchange="getOrderDate()" class="tb5"></input>
                                </td>
                        </tr>
                        <tr>
                            <td>
                                Required Date
                            </td>
                            <td>
                                <%--<asp:HiddenField ID="txtRequiredDate" runat="server" />--%>
                                <asp:TextBox ID="txtRequiredDate" required Width="175px" NAME="txtRequiredDate" 
                                    runat="server" class="tb5"></asp:TextBox>
                                <%--<a href="#" onclick="cal.select(document.forms['form1'].txtRequiredDate,'anchor2','yyyy-MM-dd'); return false;"
                                    name="anchor2" id="anchor2">select</a>--%>
                                    <input id="dtRequiredDate" type="date" onchange="getRequiredDate()" class="tb5"></input>
                                    
                                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                    ControlToCompare="txtOrderDate" ControlToValidate="txtRequiredDate" 
                                    Display="Dynamic" ErrorMessage="Must greater than Order Date" 
                                    Operator="GreaterThanEqual" Type="Date"></asp:CompareValidator>
                                    
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Shipped Date
                            </td>
                            <td>
                                <%--<asp:HiddenField ID="txtShippedDate" runat="server" />--%>
                                <asp:TextBox ID="txtShippedDate" Width="175px" NAME="txtShippedDate" 
                                    runat="server" class="tb5"></asp:TextBox>
                                <%--<a href="#" onclick="cal.select(document.forms['form1'].txtShippedDate,'anchor3','yyyy-MM-dd'); return false;"
                                    name="anchor3" id="anchor3">select</a>--%>
                                    <input id="dtShippedDate" type="date" onchange="getShippedDate()" class="tb5"></input>
                                    
                                <asp:CompareValidator ID="CompareValidator2" runat="server" 
                                    ControlToCompare="txtOrderDate" ControlToValidate="txtShippedDate" 
                                    Display="Dynamic" ErrorMessage="Must greater than Order Date" 
                                    Operator="GreaterThanEqual" Type="Date"></asp:CompareValidator>
                                    
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Shipper
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlShipper" Width="180px" runat="server" class="tb5">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Freight
                            </td>
                            <td>
                                <asp:TextBox ID="txtFreight" required Width="175px" runat="server" class="tb5"></asp:TextBox>
                                <asp:CompareValidator ID="CompareValidator3" runat="server" 
                                    ControlToValidate="txtFreight" Display="Dynamic" 
                                    ErrorMessage="Must be number and greater than 0" Operator="GreaterThanEqual" 
                                    Type="Double" ValueToCompare="0"></asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ship name
                            </td>
                            <td>
                                <asp:TextBox ID="txtShipName" required Width="175px" runat="server" class="tb5"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ship Address
                            </td>
                            <td>
                                <asp:TextBox ID="txtShipAddress" required Width="175px" Height="73px" TextMode="MultiLine"
                                    runat="server" class="tb5"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ship City
                            </td>
                            <td>
                                <asp:TextBox ID="txtShipCity" required runat="server" Width="175px" class="tb5"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ship Region
                            </td>
                            <td>
                                <asp:TextBox ID="txtShipRegion" runat="server" Width="175px" class="tb5"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ship PostalCode
                            </td>
                            <td>
                                <asp:TextBox ID="txtShipPostalCost" runat="server" Width="175px" class="tb5"></asp:TextBox>
                                <asp:CompareValidator ID="CompareValidator4" runat="server" 
                                    ControlToValidate="txtShipPostalCost" Display="Dynamic" 
                                    ErrorMessage="Must be integer number" Operator="GreaterThanEqual" 
                                    Type="Integer" ValueToCompare="0"></asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ship Country
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlShipCountry" runat="server" Width="180px" class="tb5">
                                    <asp:ListItem>France</asp:ListItem>
                                    <asp:ListItem>Spain</asp:ListItem>
                                    <asp:ListItem>Austria</asp:ListItem>
                                    <asp:ListItem>Italy</asp:ListItem>
                                    <asp:ListItem>Ireland</asp:ListItem>
                                    <asp:ListItem>Austria</asp:ListItem>
                                    <asp:ListItem>Canada</asp:ListItem>
                                    <asp:ListItem>Brazil</asp:ListItem>
                                    <asp:ListItem>Belgium</asp:ListItem>
                                    <asp:ListItem>Switzerland</asp:ListItem>
                                    <asp:ListItem>USA</asp:ListItem>
                                    <asp:ListItem>Finland</asp:ListItem>
                                    <asp:ListItem>Venezuela</asp:ListItem>
                                    <asp:ListItem>Vietnam</asp:ListItem>
                                    <asp:ListItem>Sweden</asp:ListItem>
                                    <asp:ListItem>Mexico</asp:ListItem>
                                    <asp:ListItem>Germany</asp:ListItem>
                                    <asp:ListItem>UK</asp:ListItem>
                                    <asp:ListItem>Ireland</asp:ListItem>
                                    <asp:ListItem>Portugal</asp:ListItem>
                                    <asp:ListItem>Japan</asp:ListItem>
                                    <asp:ListItem>China</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:Button ID="btnNew" Text="New" Width="65px" runat="server" 
                                    OnClick="btnNew_Click" CausesValidation="False" formnovalidate class="tb5"/>
                                <asp:Button ID="btnAdd" Text="Add" Width="65px" runat="server" OnClick="btnAdd_Click" class="tb5"/>
                                <asp:Button ID="btnUpdate" Text="Update" Width="65px" runat="server" Enabled="False"
                                    OnClick="btnUpdate_Click" class="tb5"/>
                                <asp:Button ID="btnDelete" Text="Delete" Width="65px" runat="server" Enabled="False"
                                    OnClick="btnDelete_Click" 
                                    OnClientClick="if(!confirmDelete()) return false;" CausesValidation="False" class="tb5"/>
                                <asp:Button ID="btnReload" runat="server" Text="Reload" Width="65px" style="margin-left:118px"
                                    onclick="btnReload_Click" CausesValidation="False" formnovalidate class="tb5"/>
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                    
                    <asp:GridView ID="gvOrders" runat="server" OnPageIndexChanging="gvOrders_PageIndexChanging"
                        OnSelectedIndexChanged="gvOrders_SelectedIndexChanged" AutoPostBack="true" Width="1200px"
                        BackColor="White"
                        ForeColor="Black"
                        SelectedRowStyle-ForeColor="White"
                         >
                        <HeaderStyle BackColor="Orange" />
                         <EditRowStyle ForeColor="Black" />
                        <AlternatingRowStyle BackColor="DarkGray" />
                         <SelectedRowStyle BackColor="BlueViolet" />
       
                        </asp:GridView>
                    <br />
                    <asp:Label ID="lbLabel1" Text="Search date from " runat="server"></asp:Label>
                    <asp:HiddenField ID="txtDateSearchFrom" runat="server" />
                    <%--<asp:TextBox ID="txtDateSearchFrom" Width="1px" NAME="txtDateSearchFrom" 
                        runat="server" ></asp:TextBox>--%>
                    <%--<a href="#" onclick="cal.select(document.forms['form1'].txtDateSearchFrom,'anchor1','yyyy-MM-dd'); return false;"
                        name="anchor4" id="anchor4">select</a>--%>
                    <input id="dtDateFrom" type="date" onchange="getDateFrom()" class="tb5"></input>
                        
                    <asp:Label ID="lbLabel2" Text=" To" runat="server"></asp:Label>
                    
                    <asp:HiddenField ID="txtDateSearchTo" runat="server" />
                    <%--<asp:TextBox ID="txtDateSearchTo" Width="175px" NAME="txtDateSearchTo" runat="server"></asp:TextBox>--%>
                    <%--<a href="#" onclick="cal.select(document.forms['form1'].txtDateSearchTo,'anchor1','yyyy-MM-dd'); return false;"
                        name="anchor5" id="anchor5">select</a>--%>
                        <input id="dtDateTo" type="date" onchange="getDateTo()" class="tb5"></input>
                    <br />
                    <asp:Button ID="btnSearch" runat="server" Width="65px" Text="Search" 
                        onclick="btnSearch_Click" CausesValidation="False" formnovalidate class="tb5"/>
                    <hr align="left" width="400px" />
                    <table style="width: 50%">
                        <tr>
                            <td width="10%">
                                Filter by:
                            </td>
                          <td width="30%">
                                <asp:RadioButtonList ID="rdlFilter" runat="server" RepeatDirection="Horizontal" 
                                    onselectedindexchanged="rdlFilter_SelectedIndexChanged" AutoPostBack="true">
                        <asp:ListItem>Customer</asp:ListItem>
                        <asp:ListItem>Product</asp:ListItem>
                                 </asp:RadioButtonList>        
                            </td>
                            <td>
                                <asp:DropDownList Width="180px" ID="ddlFilter" runat="server" class="tb5"></asp:DropDownList>        
                            </td>
                        </tr>
                    </table>
                    
                    <asp:Button ID="btnFilter" runat="server" Text="Filter"  Width="65px"
                    onclick="btnFilter_Click" CausesValidation="False" formnovalidate class="tb5"/>
                    </td>
                </tr>
            <tr height="50px">
               <td colspan="2">
                <hr style="border-style: double; border-width: medium" width="70%" />
               </td> 
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Button ID="btnGoToOrderDetails" formnovalidate runat="server" Text="View Order Details" 
                        onclick="btnGoToOrderDetails_Click" CausesValidation="False" class="tb5"/>
                </td>
                
            </tr>
            </table>
    </div>

 
   
</asp:Content>

